﻿
using System;
using System.Collections.Generic;
namespace fc2editor.Services
{
    public class CacheService : ICacheService
    {
        public CacheService()
        {
            cache = new Dictionary<Guid, byte[]>();
        }

        #region ICacheService Members

        public byte[] GetPicture(Guid id)
        {
            byte[] result = null;
            cache.TryGetValue(id, out result);
            return result;
        }

        public void CachePicture(Guid id, byte[] picture)
        {
            cache[id] = picture;
        }

        #endregion

        private Dictionary<Guid, byte[]> cache;
    }
}
